import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:winkai/utils/context_utils.dart';

///全局context
BuildContext? get globalContext => ContextUtils.navigatorKey.currentContext;

///全局mediaQuery
MediaQueryData? get globalMediaQuery =>
    globalContext != null ? MediaQuery.of(globalContext!) : null;

///屏幕大小
Size? get screenSize => globalMediaQuery?.size;

EdgeInsets? get screenPadding => globalMediaQuery?.padding;

///屏幕宽度
double get screenWidth => screenSize?.width ?? 0;

///屏幕高度
double get screenHeight => screenSize?.height ?? 0;

///状态栏高度
double get statusHeight => screenPadding?.top ?? 0;

///导航栏高度
double get navigationHeight => screenPadding?.bottom ?? 0;
